home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 25
/
Cream of the Crop 25.iso
/
bbs
/
mhis020.zip
/
FLOAT.MH
< prev
next >
Wrap
Text File
|
1996-09-17
|
490b
|
26 lines
#ifndef __FLOAT_MH
#define __FLOAT_MH
string division_result (long: value, long: fact, int: dig) {
int: d1, temp, counter;
if (fact = 0) {
return "n.a.";
};
temp := 1;
for (counter := 0; counter < dig; counter := counter + 1) {
temp := temp * 10;
};
d1 := value % fact * temp / fact;
if (d1 > 0) {
return ltostr (value / fact) + "." + strpadleft (itostr (d1), dig, '0');
}
else return ltostr (value / fact);
}
#endif